#include <iostream>
#include <vector>
#include <string>
#include "student.h"
#include "circle.h"
#include "sort.h"
#include "list.h"
#include "tree.h"
using namespace std;
typedef struct rect {
	int id;
	int length;
	int width;
	bool operator<(const rect& a) const {
		if (id != a.id)
			return id < a.id;
		else {
			if (length != a.length)
				return length < a.length;
			else
				return width < a.width;
		}
	}
}Rect;

//# define SORT_MAIN	
//# define CIRCLE_MAIN
//# define VEC_MAIN
//# define LIST_MAIN
# define TREE_MAIN
int main(){
#ifdef SORT_MAIN

	int arr[14] = { 6,6,16,9,8,6,5,4,2,5,7,2,2,2 };
	printArray(arr, sizeof(arr) / sizeof(int));
	bubbleSort(arr, sizeof(arr) / sizeof(int));
	selectSort(arr, sizeof(arr) / sizeof(int));
	insertSort(arr, sizeof(arr) / sizeof(int));
	shellSort(arr, sizeof(arr) / sizeof(int));
	printArray(arr, sizeof(arr) / sizeof(int));
#endif
#ifdef CIRCLE_MAIN

	Student A(20162589, "xiyinli", 59);
	Student B(20162588, "son,lee", 98);
	A.print();
	B.print();
#endif
#ifdef VEC_MAIN
	vector<Rect>vec;
	Rect rect;
	rect.id = 1;
	rect.length = 2;
	rect.width = 3;
	vec.push_back(rect);
	vector<Rect>::iterator it = vec.begin();
	cout << (*it).id << " " << endl;
#endif
#ifdef LIST_MAIN
	CLinkedList a;
	int b1;
	int b2;
	a.topFront();
	a.topBack();
	a.insertAtBack(1);
	a.print();
	a.reverse();
	a.print();
	a.insertAtBack(2);
	a.print();
	a.reverse();
	a.print();
	a.insertAtBack(3);
	a.insertAtBack(4);
	a.print();
	a.reverse();
	a.print();
	a.removeNthFromEnd(-1);
	a.print();
	a.removeNthFromEnd(0);
	a.print();
	a.removeNthFromEnd(2);
	a.print();
	a.removeNthFromEnd(2);
	a.print();
	a.removeNthFromEnd(3);
	a.print();
#endif
#ifdef TREE_MAIN
	CBinTree bst;
	bst.createSampleTree1();
	bst.prettyPrint();
#endif
	return 0;
}

